package com.ddc.study.base;

/**
 * Created on 2018/3/28.
 *
 * @author lshun
 * @version 1.0
 */
public interface BaseView {
    /**
     * run the runnable on UI thread
     *
     * @param runnable the runnable need to run on UI thread
     */
    void runOnUIThread(Runnable runnable);

    /**
     * get the string by the res id
     *
     * @param resId the string res id
     * @return the string value
     */
    String getStringValue(int resId);

    /**
     * show dialog with the default msg on view,
     * need to call {@link #dismissDialog()} before the view destroy.
     *
     * @see #showDialog(String)
     * @see #dismissDialog()
     */
    void showDialog();

    /**
     * show dialog on view, need to call {@link #dismissDialog()} before the view destroy.
     *
     * @param msg the msg which shown on the dialog.
     *            If is null, the dialog will show the default msg.
     * @see #dismissDialog()
     */
    void showDialog(String msg);

    /**
     * hide the dialog on view, often call after {@link #showDialog(String)}.
     *
     * @see #showDialog(String)
     */
    void dismissDialog();
}
